package com.lizhongbao.demo.controller;

import com.alibaba.fastjson.JSONObject;
import com.lizhongbao.system.client.BizClient;
import com.lizhongbao.system.domain.dto.TestQueryDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试 Controller
 *
 * @Author lizhongbao
 * @Date 2019/12/23 17:23
 **/
@RestController
@RequestMapping("/controller/v1/biz")
public class BizController {

    @Autowired
    private BizClient bizClient;

    @GetMapping()
    public JSONObject page(TestQueryDto dto,
                           @RequestParam(name = "page", required = false, defaultValue = "1") Long page,
                           @RequestParam(name = "size", required = false, defaultValue = "10") Long size) {
        return bizClient.page(dto, page ,size);
    }

    @GetMapping(value = "/list")
    public JSONObject list(TestQueryDto dto) {
        return bizClient.list(dto);
    }

}
